package com.estar.assistsurvy.activity;

import com.estar.app.appsrvyspds.domain.ReturnSubVideoSrvyVO;
import com.estar.assistsurvy.R;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.LinearLayout;

public class SelectCarActivity extends BaseActivity implements OnClickListener{

	private LinearLayout moreCars,singleCar;
	private Intent intent;
	private LinearLayout returnBack;
	private ReturnSubVideoSrvyVO returnSubVideoSrvyVo;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_selectcar);
		initView();
	}
	
	private void initView(){
		moreCars=find(R.id.moreCars);
		moreCars.setOnClickListener(this);
		singleCar=find(R.id.singleCar);
		singleCar.setOnClickListener(this);
		returnBack=find(R.id.returnBack);
		returnBack.setOnClickListener(this);
		intent=getIntent();
		returnSubVideoSrvyVo = (ReturnSubVideoSrvyVO) intent.getSerializableExtra("returnSubVideoSrvyVO");

	}
	
	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
		case R.id.moreCars:
			showShortToast("该功能暂未开放，敬请期待!");
			break;
			
		case R.id.singleCar:
			if(returnSubVideoSrvyVo==null){
				showShortToast("未获取到当前按件信息，请退出重试!");
				return;
			}
			Intent intent=new Intent(SelectCarActivity.this, DemagedPositionActivity.class);
			intent.putExtra("returnSubVideoSrvyVO",returnSubVideoSrvyVo);
			startActivity(intent);
			break;
			
		case R.id.returnBack:
			finish();
			break;

		default:
			break;
		}
	}
}
